fix: Avoid auto-reload for recently created source directory - #3697
Merged
Merged
Conversation
Watchpack has a bug that caused it to dispatch change events for files that were created recently (up to 2 seconds before now). This can trigger an unwanted auto-reload, e.g. in the scenario of an extension developer building an extension and using `web-ext run` to immediately launch that built package. Fixing this bug caused test.cli.run-target-chromium.js to time out because the "with auto-reload" test got stuck, because it waited until "The extension will reload if any source file changes" was logged before writing a file to trigger auto-reload, but that message was logged before the watcher was registered. To fix that test issue, move the logging after initializing the reload strategy.
willdurand
approved these changes
Sep 10, 2026
Merged
willdurand
added a commit
that referenced
this pull request
Sep 21, 2026
## main changes - Added: `web-ext lint` supports Firefox schemas up to Fx157 (included) - Fixed: Avoid auto-reload for recently created source directory (#3697) - Fixed: Loaded config files with URL characters in their paths (#3825) - Fixed: stabilize program tests locale (#3701) ## dependencies - Updated: dependency `@babel/runtime` to 8.0.5 (#3848) - Updated: dependency `addons-linter` to 10.13.0 (#3850) - Updated: dependency `jszip` to 3.10.2 (#3842) - Updated: dependency `open` to 11.0.3 (#3853) ## dev dependencies - Updated: dependency `@babel/cli` to 8.0.5 (#3845) - Updated: dependency `@babel/core` to 8.0.5 (#3849) - Updated: dependency `@babel/eslint-parser` to 8.0.5 (#3847) - Updated: dependency `@babel/preset-env` to 8.0.5 (#3846) - Updated: dependency `@babel/register` to 8.0.5 (#3844) - Updated: dependency `@eslint/compat` to 2.1.1 (#3831) - Updated: dependency `@eslint/eslintrc` to 3.3.7 (#3827) - Updated: dependency `adm-zip` to 0.6.1 (#3851) - Updated: dependency `globals` to 17.12.0 (#3826) - Updated: dependency `mocha` to 12.0.1 (#3854) - Updated: dependency `sinon` to 22.1.0 (#3786) ## others - Added: add workflow to create draft releases (#3840) - Added: SECURITY.md (#3810)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Watchpack has a bug that caused it to dispatch change events for files that were created recently (up to 2 seconds before now). This can trigger an unwanted auto-reload, e.g. in the scenario of an extension developer building an extension and using
web-ext runto immediately launch that built package.For more details on the Watchpack issue, see webpack/watchpack#295.
Since
startTime's documented use is to detect changes in the past, and we passDate.now(), we can drop it without negatively affecting the desired behavior. Auto reload is still expected to work.Note: this PR also includes another change (moving "The extension will reload if any source file changes" log after initializing the watcher), because the fix to the watchpack bug caused
test.cli.run-target-chromium.jsto get stuck (because it was awaiting a reload that never came due to the watcher not having been initialized when the test triggered the file write).